int* sortArrayByParity(int* nums, int numsSize, int* returnSize) {
    int* a = (int*)malloc(sizeof(int) * numsSize);
    int n = 0;
    for (int i = 0; i < numsSize; i++)
    {
        if (nums[i] % 2 == 0)
        {
            a[n++] = nums[i];
        }
    }
    for (int j = 0; j < numsSize; j++)
    {
        if (nums[j] % 2 != 0)
        {
            a[n++] = nums[j];
        }
    }
    *returnSize = n;
    return a;
}